Advanced Options#

import panel as pn
import waloviz as wv
wv.extension()

In WaloViz there are a few features which are situational and nuanced, these advanced options make WaloViz more than just simple, but powerful.

The following demonstrations are examples of advanced options and their effects in action, for the full list of options go to the Reference Manual.

Resampling#

To display an audio with a different sample-rate, just set the sr variable in addition to the source:

pn.Row(
    wv.Audio("local_data/Yoshi.wav", minimal=True), 
    wv.Audio("local_data/Yoshi.wav", minimal=True, sr=8000)
)

Spectrogram Resolution#

To set the spectrogram to a different resolution in frequency or time, use the frame_ms and hop_ms variables:

pn.Row(
    wv.Audio("local_data/Yoshi.wav", minimal=True, frame_ms=50, hop_ms=25), 
    wv.Audio("local_data/Yoshi.wav", minimal=True, frame_ms=0.5, hop_ms=0.25)
)

Colors#

To set the colormap use cmap, and set colorbar=True for a log scale color bar:

pn.Row(
    wv.Audio("local_data/Yoshi.wav", minimal=True, cmap="viridis", colorbar=True), 
    wv.Audio("local_data/Yoshi.wav", minimal=True, cmap="jet", colorbar=True)
)

Theme#

You can set the bokeh theme with the theme option, a string will load one of the predefined themes of bokeh:

  1. "dark_minimal"

  2. "light_minimal"

  3. "caliber"

  4. "contrast"

  5. "night_sky"

pn.Row(
    wv.Audio("local_data/Yoshi.wav", minimal=True, theme="light_minimal"),
    wv.Audio("local_data/Yoshi.wav", minimal=True, theme="night_sky")
)

Download & Native Player#

You can use the download_button and native_player options to show or hide them:

pn.Row(
    wv.Audio("local_data/Yoshi.wav"),
    wv.Audio("local_data/Yoshi.wav", download_button=False, native_player=True)
)

Title#

Use the title to set an name for the player, it will be used when saving the plot to an HTML file, also you can embed the title with the player with the embed_title option:

pn.Row(
    wv.Audio("local_data/Yoshi.wav"),
    wv.Audio("local_data/Yoshi.wav", title="Big Yoshi", embed_title=True)
)

Other options#

There are more options to WaloViz, for example:

  • sync_legends - makes the over curves appear and disappear over both channels with a single click

  • freq_label - sets the frequency axis label, when set to None no label is displayed and some width space is cleared Find out more in the [Reference Manual](../reference-manual/waloviz._user_functions.

This web page was generated from a Jupyter notebook and not all interactivity will work on this website. Right click to download and run locally for full Python-backed interactivity.